package com.teach.javafxclient.controller.base;


import javafx.fxml.FXML;
import javafx.scene.layout.Pane;
import javafx.scene.control.Label;

public class AcademicPerformanceItemController {
    @FXML
    public Label courseName;
    @FXML
    private Label teacherName;
    @FXML
    private Label credit;
    @FXML
    private Label termName;
    @FXML
    private Label endtext;
    @FXML
    private Pane mainPage;
    @FXML
    private Pane innerPage;

    public void setItem(String coursename, String teachername, String singlecredit, String termname, Boolean ended, String finnalScore){
        courseName.setText(coursename);
        teacherName.setText(teachername);
        credit.setText(singlecredit);
        termName.setText(termname);
        if(ended){
            mainPage.setStyle("-fx-background-color:#cdf3c6");
            mainPage.setStyle("-fx-background-radius: 20");
            endtext.setText(finnalScore);
            endtext.setStyle("-fx-background-color:#690c09");
        }else{
            mainPage.setStyle("-fx-background-color:#d5e9ff");
            mainPage.setStyle("-fx-background-radius: 20");
            innerPage.setStyle("-fx-background-color:#cdf3c6");
            innerPage.setStyle("-fx-border-color: #647062");

            endtext.setText("进行中");
        }
    }

}
